package com.jiyun.vo;

import lombok.Data;
import lombok.ToString;


@Data
@ToString
public class ResultResopnse<T> {
    /**
     * 状态码  1：成功
     *        2：失败
     */
    public String code;

    /**
     * 返回提示信息 “查询成功”
     *
     */
    public String message;

    /**
     * 返回的数据
     */
    public T data;


    public static ResultResopnse success(Object data){
        ResultResopnse resultResopnse = new ResultResopnse<Object>();
        resultResopnse.setCode("1");
        resultResopnse.setMessage("SUCCESS");
        resultResopnse.setData(data);
        return resultResopnse;
    }

    public static ResultResopnse<Object> error(){
        ResultResopnse resultResopnse = new ResultResopnse<Object>();
        resultResopnse.setCode("2");
        resultResopnse.setMessage("ERROR");
        return resultResopnse;
    }




}